//: Playground - noun: a place where people can play

import UIKit

let rect = CGRect(x: 0, y: 0, width: 100, height: 100)
let view : UIView = UIView(frame: rect)

view.backgroundColor = UIColor.red

let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
btn.backgroundColor = UIColor.blue
//swift枚举类型
//方式一：如果可以根据上下文推断出该枚举的类型，直接使用 .具体类型
//方式二：如果上下文推断不出来类型，枚举类型.具体类型
//btn.setTitle("你好", for: .normal)
btn.setTitle("你好", for: UIControlState.normal)

view.addSubview(btn)

